/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-09-07
 * Time: 17:53
 */
public class XiaoShi {
    public static int missingNumber(int[] n) {

        int count = 0;


        int n1 = n.length;

        for (int i = 0; i < n1; i++) {
            count += n[i];
        }
        return n1*(n1+1)/2-count;
    }
    public static void main(String[] args) {
    int[] array={0,1,2,3,5,7,6,9,10};
        int key=missingNumber(array);
        System.out.println(key);
    }
}
